<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/12/2 0002
 * Time: 16:56
 */

namespace app\admin\controller;


use think\Request;

class UploadFile extends Base
{
    protected function _initialize(){
        $this->checkLogin();
        $this->menuLoad();
    }

    public function oneFile($dir,$file){
        $info = $file->move($dir);
        if($info){
            // 成功上传后 获取上传信息
            $rs['code'] = '1';
            $rs['msg'] = date("Ymd").'/'.$info->getFilename();
        }else{
            // 上传失败获取错误信息
            $rs['code'] = '0';
            $rs['msg'] = $file->getError();
        }
        return $rs;

    }

    public function moreFile(){

    }
}